#!/bin/bash
echo '拉取镜像到阿里云仓库，本地从阿里云仓库拉取镜像'
echo "执行的文件名：$0";
echo "第一个参数为：$1";
echo "第二个参数为：$2";
docker pull $1;
imageId=`docker images $1 |tail -n 1 | awk -F ' ' '{print $3}'`
echo $1'对应镜像'$imageId
docker tag $imageId  registry.cn-hangzhou.aliyuncs.com/bwp/$2
docker push registry.cn-hangzhou.aliyuncs.com/bwp/$2 
